# This is a sample Python script.

# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.

import os
import sys
from time import sleep
from playwright.sync_api import sync_playwright


def open_url(url):
    with sync_playwright() as driver:
        browser = driver.chromium.launch(headless=False, args=['--start-maximized'])
        context = browser.new_context(no_viewport=True)
        page = context.new_page()
        page.goto(url)
        while True:
            pass


if __name__ == '__main__':
    url = "https://www.baidu.com/"
    open_url(url)

    # path = os.path.dirname(sys.argv[0])
    # f = os.path.join(path, 'url.txt')
    #
    # websites = open(f).readlines()
    #
    # open_url(websites[0])

"""
https://www.cnblogs.com/keenajiao/p/17745875.html

pip install playwright
playwright install
"""
